import * as config from '../util/config';
import axios from 'axios';

// 改变active
export function changeActive(table, id, active) {
    return axios.get(config.localhostUrl + `change_active?table=${table}&id=${id}&active=${active}`);
}

export function adminUpload(formdata) {
    return axios.post(config.localhostUrl + 'upload_image', formdata, {
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
}

export function deleteImg(imageUrl) {
    return axios.post(config.localhostUrl + 'delete_img', { imageUrl })
}

export function deleteImgs(imageUrl) {
    return axios.post(config.localhostUrl + 'delete_imgs', { imageUrl })
}